1) Field of the Invention
The present invention relates to a bar-code reader.
2) Description of the Related Art
In the field of products distribution, a bar-code system is a known system. In this bar-code system, a bar code is provided to a product in advance and when the product is held up to a bar-code reader (bar-code scanner), the bar code of the product is read. By reading the bar code of a product, information of a product such as product price, product name etc. is recorded in a register
Concretely, in the bar-code unit, a following series of processes is performed.                (1) A light beam is irradiated on a bar code that is formed by an array of width information of black bars and white bars and light reflected from the bar code is received. An electric signal having amplitude corresponding to an optical power of the reflected light, is generated.        (2) From the change in the amplitude of the electric signal, boundary signals (edge signals) of boundary from a white bar to a black bar and of boundary from a black bar to white bar are extracted.        (3) Distance between the edge signals that are extracted is measured as a bar-width counting value by using a clock that has a resolution power from tens to hundreds of times of the bar width.        (4) From the counting value that is measured, the width of each bar that forms the bar code is measured and a ratio of widths of the white bars and black bars is calculated        
Thus, in the conventional bar-code reader, if the light that is reflected from the bar code has sufficient optical power and has large amplitude, the ratio of widths of the white bars and the black bars can be known accurately. Due to this, the information of a product that is provided with a bar code can be recorded accurately in the register etc.
[Patent Document 1]
Japanese Patent Application Laid-open Publication No. Hei10-261043.
However, taking into consideration an environment in which a bar-code reader is operated practically, the light reflected from the bar code is not always sufficient. Therefore, an error occurs in reading of white bars and black bars-of the bar code.
Particularly, when each amplitude of a module point is viewed separately, in a practical environment, in most of the cases there happens to be a decrease in the amplitude. Therefore, it is difficult to make an accurate judgment of whether it is an edge ‘1’ that changes from a black bar to a white bar, or an edge ‘−1’ that changes from a white bar to a black bar, or a no edge area ‘0’.
Due to this, an efficient and accurate judgment of whether each module point is an edge that changes from a black bar to a white bar, or an edge that changes from a white bar to a black bar, or a no edge area, becomes very important. A bar-code reader in patent document 1 is an apparatus that decodes a string like a bar code that is encoded by combining a maximum likelihood method and a critical distance decoding. However, in this case, the maximum likelihood method is employed only for decoding and not for ternarizing the amplitude of each module point. Therefore, patent document 1 has not solved this problem.